<?php
class Nutri_Form_SearchFilter extends Zend_Form
{	
	public function init()
    {
        $this->setMethod('get');

        $this->setDisableLoadDefaultDecorators(true);
 
        $this->addDecorator('FormElements')
             ->addDecorator('Form');
        
        $this->addElement('text', 'query', array(
            'label'      => 'Texto a buscar*:',
            'required'   => true,
            'filters'    => array(
        		array('filter'=>'StringTrim'),
        		array('filter'=>'StripTags')
        	),
            'validators' => array(
        		array('validator' => 'StringLength', 'options' => array(0, 255)))
        ));
        
        $this->addElement('submit', 'submit', array(
            'ignore'   => true,
            'label'    => 'buscar',
        	'id' => 'searchButton'
        ));
        
        //Set the decorators we need:
        $this->setElementDecorators(array(
            'ViewHelper',
            'Label',
            'Errors',
            new Zend_Form_Decorator_HtmlTag(array('tag' => 'div')) //wrap elements in <div>'s
        ));
        
        //Remove label from submit button:
        $this->submit->removeDecorator('Label');
        
    }
}